package tech.bmatch.redpack.service;

import tech.bmatch.redpack.model.MyRedPack;
import tech.bmatch.redpack.model.MySharedRedPack;
import tech.bmatch.redpack.model.RedPack;
import tech.bmatch.redpack.model.RedPackType;
import tech.bmatch.redpack.model.SharedRedPack;
import tech.bmatch.redpack.param.CreateRedPackParam;

import java.util.List;

/**
 * 红包服务
 *
 * @author: Awake
 * @date: 2018-11-02 17:17
 **/
public interface RedPackService {
    /**
     * 创建红包
     *
     * @param createRedPackParam
     * @return
     */
    RedPack create(CreateRedPackParam createRedPackParam);

    /**
     * 查询红包
     *
     * @param redPackType
     * @return
     */
    List<RedPack> query(RedPackType redPackType);


    /**
     * 天降红包服务
     *
     * @param userId 用户ID
     * @return
     */
    List<MyRedPack> rainPack(String userId);

    /**
     * 抢红包的主分享红包创建
     *
     * @param sharedRedPack 初始参数
     * @return 主分享红包
     */
    SharedRedPack createSharedPack(SharedRedPack sharedRedPack);


    /**
     * 抢红包
     *
     * @param sharedRedPackId 主分享红包ID
     * @param userId 用户ID
     * @return
     */
    List<MySharedRedPack> grabPack(String sharedRedPackId, String userId);
}
